#! /bin/bash

Tumor=$1
out_path=$2

## 得到每个人的整合的信息
echo ${Tumor}
mkdir -p ${out_path}/${Tumor}
ln -snf ${Titan_path}/allModel_NonTumor/${Tumor}*pdf ${out_path}/${Tumor}/
cat ${Titan_path}/allModel_NonTumor/${Tumor}_allModel_params.tsv | \
awk -F'\t' '{OFS="\t"}{if($1==2){$8=$6*0.95}else{$8=$6};if($8=="loglik"){$8="loglik_revise"};print }' \
> ${out_path}/${Tumor}/${Tumor}_allModel_params.abstarct.tsv

## VAF
# ${titianCNA_rscript} ${scripts_path}/TitanCNA_VafDistribution.R --sample ${Tumor} \
# --input_file ${ccf_path}/${Tumor}*filterStep1.maf --output ${Images_path}/VAF
# ln -snf ${Images_path}/VAF/${Tumor}.pdf ${out_path}/${Tumor}/${Tumor}_vaf.pdf

## Facets纯度
cat ${Titan_path}/CheckModel_NonTumor/All_Model.tsv | grep -E "${Tumor}|Tumor" \
> ${out_path}/${Tumor}/${Tumor}_TITAN-Facest.tsv